<template>
  <div class="drawer-box">
    <div class="tips">基础信息</div>
    <div class="infomation-box">
      <el-descriptions :column="2" border>
        <el-descriptions-item label="项目名称" :span="2">{{ changeInfo.project_name }}</el-descriptions-item>
        <el-descriptions-item label="项目编号">{{ changeInfo.project_number }}</el-descriptions-item>
        <el-descriptions-item label="发起人">{{ changeInfo.user_name }}</el-descriptions-item>
        <el-descriptions-item label="增减项类型" v-if="fieldShowFunc('increase_or_decrease')">
          {{ changeInfo.increase_or_decrease == 1 ? '增项' : '减项' }}
        </el-descriptions-item>
        <el-descriptions-item label="增减项原因" v-if="fieldShowFunc('reason_type')">
          {{ changeInfo.reason_type == 1 ? '客户原因' : changeInfo.reason_type == 2 ? '现场原因' : '其他' }}
        </el-descriptions-item>
        <el-descriptions-item label="预计开工日期"
          v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('zj_start_date')">
          {{ changeInfo.start_date }}
        </el-descriptions-item>
        <el-descriptions-item label="预计完工日期"
          v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('zj_end_date')">
          {{ changeInfo.end_date }}
        </el-descriptions-item>
        <el-descriptions-item label="预计工期"
          v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('expect_duration_days')">
          {{ changeInfo.expect_duration_days }}天
        </el-descriptions-item>
        <el-descriptions-item label="增减项内容" v-if="fieldShowFunc('change_content')">
          {{ changeContent(changeInfo.change_content) }}
        </el-descriptions-item>
        <el-descriptions-item label="施工内容" :span="2" v-if="fieldShowFunc('construction_content')">
          {{ changeInfo.construction_content }}
        </el-descriptions-item>
        <el-descriptions-item label="备注" :span="2" v-if="fieldShowFunc('zj_desc')">
          {{ changeInfo.remark || '--' }}
        </el-descriptions-item>
        <el-descriptions-item label="附件" :span="2" v-if="fieldShowFunc('zj_change_file')">
          <span class="theme-color underline span-file" v-for="(item, idx) in changeInfo.change_items_file" :key="idx"
            @click="$fileViewHandle(item)">{{ item.file_name }}</span>
          <span v-if="changeInfo.change_items_file && changeInfo.change_items_file.length == 0">--</span>
        </el-descriptions-item>
      </el-descriptions>
    </div>

    <div class="tips">操作历史</div>
    <div class="oper-history-box">
      <!-- <el-empty style="margin-top: 150px" description="无数据" ></el-empty> -->
      <el-timeline class="timeline" :reverse="false">
        <el-timeline-item v-for="(item, index) in changeInfo.log_list " :key="index">
          <div class="setp-box">
            <div class="setp-top flex ac jb">
              <p class="time">{{ item.created_at }}</p>
              <div class="user-box flex ac">
                <img class="avater" :src="item.handlers_image" />
                {{ item.handlers_position }}-{{ item.handlers_name }}
              </div>
            </div>
            <div class="setp-content" v-if="item.change_status == 10 && item.handlers_position != '造价主管'">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="2">
                <el-descriptions-item label="增减项原因" v-if="fieldShowFunc('reason_type')">
                  {{ changeInfo.reason_type == 1 ? '客户原因' : changeInfo.reason_type == 2 ? '现场原因' : '其他' }}
                </el-descriptions-item>
                <el-descriptions-item label="增减项类型" v-if="fieldShowFunc('increase_or_decrease')">
                  {{ changeInfo.increase_or_decrease == 1 ? '增项' : '减项' }}
                </el-descriptions-item>
                <el-descriptions-item label="预计开工日期"
                  v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('zj_start_date')">
                  {{ changeInfo.start_date }}
                </el-descriptions-item>
                <el-descriptions-item label="预计完工日期"
                  v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('zj_end_date')">
                  {{ changeInfo.end_date }}
                </el-descriptions-item>
                <el-descriptions-item label="预计工期"
                  v-if="changeInfo.increase_or_decrease == 1 && fieldShowFunc('expect_duration_days')">
                  {{ changeInfo.expect_duration_days }}天
                </el-descriptions-item>
                <el-descriptions-item label="增减项内容" v-if="fieldShowFunc('change_content')">
                  {{ changeContent(changeInfo.change_content) }}
                </el-descriptions-item>
                <el-descriptions-item label="施工内容" :span="2" v-if="fieldShowFunc('construction_content')">
                  {{ changeInfo.construction_content }}
                </el-descriptions-item>
                <el-descriptions-item label="备注" :span="2" v-if="fieldShowFunc('zj_desc')">
                  {{ changeInfo.remark || '--' }}
                </el-descriptions-item>
                <el-descriptions-item label="附件" :span="2" v-if="fieldShowFunc('zj_change_file')">
                  <span class="theme-color underline span-file" v-for="(item, idx) in changeInfo.change_items_file"
                    :key="idx" @click="$fileViewHandle(item)">{{ item.file_name }}</span>
                  <span v-if="changeInfo.change_items_file.length == 0">--</span>
                </el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 10 && item.handlers_position == '造价主管'">
              <div class="title">{{ item.content }}</div>
            </div>
            <div class="setp-content" v-if="item.change_status == 20">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="2">
                <el-descriptions-item label="报价类型"
                  v-if="fieldShowFunc('zj_quotation_type')">增减项施工报价</el-descriptions-item>
                <el-descriptions-item label="报价金额" v-if="fieldShowFunc('zj_quotation_amount')">
                  {{ item.form_data.quotation_amount }}元
                </el-descriptions-item>
                <el-descriptions-item label="基础装修费" v-if="fieldShowFunc('zj_basic_decoration_fee')">
                  {{ item.form_data.basic_decoration_fee }}元
                </el-descriptions-item>
                <el-descriptions-item label="主材采购费" v-if="fieldShowFunc('zj_material_costs')">
                  {{ item.form_data.material_costs }}元
                </el-descriptions-item>
                <el-descriptions-item label="税金" v-if="fieldShowFunc('zj_quotation_taxes')">
                  {{ item.form_data.quotation_taxes }}元
                </el-descriptions-item>
                <el-descriptions-item label="成本金额" v-if="fieldShowFunc('zj_cost_amount')">
                  {{ item.form_data.cost_amount }}元
                </el-descriptions-item>
                <el-descriptions-item label="现场采购成本" v-if="fieldShowFunc('zj_procurement_cost')">
                  {{ item.form_data.procurement_cost }}元
                </el-descriptions-item>
                <el-descriptions-item label="公司集采成本" v-if="fieldShowFunc('zj_centralized_procurement_cost')">
                  {{ item.form_data.centralized_procurement_cost }}元
                </el-descriptions-item>
                <el-descriptions-item label="管理成本" v-if="fieldShowFunc('zj_management_costs')">
                  {{ item.form_data.management_costs }}元
                </el-descriptions-item>
                <el-descriptions-item label="利润金额" v-if="fieldShowFunc('zj_profit_amount')">
                  {{ item.form_data.profit_amount }}元
                </el-descriptions-item>
                <el-descriptions-item label="利润率" v-if="fieldShowFunc('zj_profit_ratio')">
                  {{ item.form_data.profit_ratio }}%
                </el-descriptions-item>
                <el-descriptions-item label="增减项金额" v-if="fieldShowFunc('change_amount')">
                  {{ item.form_data.change_amount }}元
                </el-descriptions-item>
                <el-descriptions-item label="报价附件" :span="2" v-if="fieldShowFunc('zj_quotation_file')">
                  <template v-for="(item2, idx) in item.form_data.project_quotation_file">
                    <span class="theme-color underline span-file" v-if="item2.type == 1" :key="idx"
                      @click="$fileViewHandle(item2)">{{ item2.file_name
                      }}</span>
                  </template>
                </el-descriptions-item>
                <el-descriptions-item label="成本附件" :span="2" v-if="fieldShowFunc('zj_cost_list_file')">
                  <template v-for="(item2, idx) in item.form_data.project_quotation_file">
                    <span class="theme-color underline span-file" v-if="item2.type == 2" :key="idx"
                      @click="$fileViewHandle(item2)">{{ item2.file_name
                      }}</span>
                  </template>
                </el-descriptions-item>
                <el-descriptions-item label="利润附件" :span="2" v-if="fieldShowFunc('zj_profit_statement_file')">
                  <template v-for="(item2, idx) in item.form_data.project_quotation_file">
                    <span class="theme-color underline span-file" v-if="item2.type == 3" :key="idx"
                      @click="$fileViewHandle(item2)">{{ item2.file_name
                      }}</span>
                  </template>
                </el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 25">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="1">
                <el-descriptions-item label="拒绝理由">{{ item.remark }}</el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 30">
              <div class="title">{{ item.content }}</div>
            </div>
            <div class="setp-content" v-if="item.change_status == 35">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="1">
                <el-descriptions-item label="拒绝理由">{{ item.remark }}</el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 40">
              <div class="title">{{ item.content }}</div>
            </div>
            <div class="setp-content" v-if="item.change_status == 50">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="2">
                <el-descriptions-item label="收款类型" v-if="fieldShowFunc('payment_type')">增项款</el-descriptions-item>
                <el-descriptions-item label="收款金额" v-if="fieldShowFunc('amount_collected')">
                  {{ item.form_data.amount_collected }}元
                </el-descriptions-item>
                <el-descriptions-item label="收款账户" :span="2"
                  v-if="fieldShowFunc('receiving_account') || fieldShowFunc('account_number')">
                  {{ fieldShowFunc('receiving_account') ? item.form_data.receiving_account : '' }}
                  {{ fieldShowFunc('account_number') ? item.form_data.account_number : '' }}
                </el-descriptions-item>
                <el-descriptions-item label="收款凭证" :span="2" labelStyle="width: 100%; margin-bottom: 5px;"
                  v-if="fieldShowFunc('voucher_file')">
                  <el-image v-for="(item2, idx) in item.form_data.voucher_file" :key="idx"
                    style="width: 100px; height: 100px; margin-right: 10px;" :src="item2.file_url"
                    :preview-src-list="[item2.file_url]">
                  </el-image>
                </el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 55">
              <div class="title">{{ item.content }}</div>
              <el-descriptions :column="1">
                <el-descriptions-item label="驳回理由">{{ item.remark }}</el-descriptions-item>
              </el-descriptions>
            </div>
            <div class="setp-content" v-if="item.change_status == 60">
              <div class="title">{{ item.content }}</div>
            </div>
          </div>
        </el-timeline-item>
      </el-timeline>
    </div>
    <div class="oper-box" v-if="userInfo.position_id == 5 && changeInfo.change_status == 10">
      <el-button type="primary" @click="dialogOpen('cjzjd')">出具造价单</el-button>
    </div>
    <div class="oper-box" v-if="userInfo.position_id == 4 && changeInfo.change_status == 10">
      <el-button type="primary" @click="dialogOpen('cxfpzjy')">重新分配造价员</el-button>
    </div>
    <div class="oper-box" v-if="userInfo.position_id == 7 && changeInfo.change_status == 20">
      <el-button type="primary" @click="dialogOpen('zjdsh')">造价单审核</el-button>
    </div>
    <div class="oper-box" v-if="userInfo.position_id == 4 && changeInfo.change_status == 30">
      <el-button type="primary" @click="dialogOpen('zjdsh')">造价单审核</el-button>
    </div>
    <div class="oper-box"
      v-if="userInfo.position_id == 2 && changeInfo.change_status == 40 && changeInfo.increase_or_decrease == 1">
      <el-button type="primary" @click="dialogOpen('sfpz')">提交增项收款凭证</el-button>
    </div>
    <div class="oper-box" v-if="userInfo.position_id == 9 && changeInfo.change_status == 50">
      <el-button type="primary" @click="dialogOpen('skqr')">收款确认</el-button>
    </div>
    <!-- 重新分配造价员 -->
    <el-dialog @close="dialogClose('cxfpzjy')" :close-on-click-modal="false" :append-to-body="true" title="重新分配造价员"
      :visible.sync="cxfpzjyVisible" width="400px">
      <div class="scroll-view">
        <el-form :model="cxfpzjyRuleForm" :rules="cxfpzjyRules" ref="cxfpzjyRuleForm" label-position="left"
          class="form-box">
          <el-form-item label="造价员" prop="user_idx">
            <el-select filterable class="input-box" v-model="cxfpzjyRuleForm.user_idx" placeholder="请选择工程经理">
              <el-option v-for="(item, idx) in adminList" :key="idx" :label="item.name" :value="idx"></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer">
        <el-button type="primary" @click="cxfpzjySubmit('cxfpzjyRuleForm')" :loading="cxfpzjyRuleForm.subimtLoading">提交</el-button>
        <el-button @click="dialogClose('cxfpzjy')">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 出具造价单弹窗 -->
    <el-dialog @close="dialogClose('cjzjd')" :close-on-click-modal="false" :append-to-body="true" title="出具增减项造价单"
      :visible.sync="cjzjdVisible" width="950px">
      <div class="scroll-view">
        <el-form :model="cjzjdRuleForm" :rules="cjzjdRules" ref="cjzjdRuleForm" label-position="left" class="form-box"
          :inline="true">
          <!-- <el-form-item label="增项预计开工日期" prop="start_date" v-if="changeInfo.increase_or_decrease == 1">
            <el-date-picker class="input-box" v-model="cjzjdRuleForm.start_date" type="date" placeholder="选择订货日期"
              clearable value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" @change="startDateChange">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="增项预计完工日期" prop="end_date" v-if="changeInfo.increase_or_decrease == 1">
            <el-date-picker class="input-box" :disabled="!cjzjdRuleForm.start_date" v-model="cjzjdRuleForm.end_date"
              type="date" placeholder="选择到货日期" clearable value-format="yyyy-MM-dd" :picker-options="pickerOptionsStart_"
              @change="endDateChange">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="增项预计工期" prop="day" v-if="changeInfo.increase_or_decrease == 1">
            <el-input v-model="cjzjdRuleForm.day" :disabled="true" placeholder="请输入预计工期">
              <div slot="suffix" style="width: 25px;">天</div>
            </el-input>
          </el-form-item> -->
          <el-form-item label="基础装修费" prop="basic_decoration_fee">
            <el-input class="input-box" v-model="cjzjdRuleForm.basic_decoration_fee" placeholder="请输入基础装修费"
              v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="主材采购费用" prop="material_costs">
            <el-input class="input-box" v-model="cjzjdRuleForm.material_costs" placeholder="请输入主材采购费用"
              v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="税金" prop="quotation_taxes">
            <el-input class="input-box" v-model="cjzjdRuleForm.quotation_taxes" placeholder="请输入税金" v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="现场采购成本" prop="procurement_cost">
            <el-input class="input-box" v-model="cjzjdRuleForm.procurement_cost" placeholder="请输入现场采购成本"
              v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="公司集采成本" prop="centralized_procurement_cost">
            <el-input class="input-box" v-model="cjzjdRuleForm.centralized_procurement_cost" placeholder="请输入公司集采成本"
              v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="管理成本" prop="management_costs">
            <el-input class="input-box" v-model="cjzjdRuleForm.management_costs" placeholder="请输入管理成本"
              v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="增减项金额" prop="change_amount">
            <el-input class="input-box" v-model="cjzjdRuleForm.change_amount" placeholder="请输入增减项金额" v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="报价金额">
            <el-input class="input-box" :value="countMoney('bj')" disabled v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="成本金额">
            <el-input class="input-box" :value="countMoney('cb')" disabled v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="利润金额">
            <el-input class="input-box" :value="countMoney('lr')" disabled v-input-limit="2">
              <span slot="suffix">元</span>
            </el-input>
          </el-form-item>
          <el-form-item label="利润率">
            <el-input class="input-box" :value="countMoney('lrl')" disabled v-input-limit="2">
              <span slot="suffix">%</span>
            </el-input>
          </el-form-item>
          <el-form-item label="报价单文件 (.ppt,.xls,.pdf,.doc,.docx,.xlsx)" prop="quotation_file">
            <el-upload ref="bjupload" accept=".ppt,.xls,.pdf,.doc,.docx,.xlsx"
              :on-change="(file, fileList) => { cjzjdChangeFile(file, fileList, 'quotation_file') }"
              :on-remove="(file, fileList) => { cjzjdFileRemove(file, fileList, 'quotation_file') }"
              :auto-upload="false" :file-list="cjzjdRuleForm.quotation_file" action="#">
              <el-button size="small" icon="el-icon-plus">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="成本单文件 (.ppt,.xls,.pdf,.doc,.docx,.xlsx)" prop="cost_list_file">
            <el-upload ref="cbupload" accept=".ppt,.xls,.pdf,.doc,.docx,.xlsx"
              :on-change="(file, fileList) => { cjzjdChangeFile(file, fileList, 'cost_list_file') }"
              :on-remove="(file, fileList) => { cjzjdFileRemove(file, fileList, 'cost_list_file') }"
              :auto-upload="false" :file-list="cjzjdRuleForm.cost_list_file" action="#">
              <el-button size="small" icon="el-icon-plus">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="利润单文件 (.ppt,.xls,.pdf,.doc,.docx,.xlsx)" prop="profit_statement_file">
            <el-upload ref="lrupload" accept=".ppt,.xls,.pdf,.doc,.docx,.xlsx"
              :on-change="(file, fileList) => { cjzjdChangeFile(file, fileList, 'profit_statement_file') }"
              :on-remove="(file, fileList) => { cjzjdFileRemove(file, fileList, 'profit_statement_file') }"
              :auto-upload="false" :file-list="cjzjdRuleForm.profit_statement_file" action="#">
              <el-button size="small" icon="el-icon-plus">点击上传</el-button>
            </el-upload>
          </el-form-item>
          <el-form-item label="备注" prop="remark">
            <el-input class="input-box" v-model="cjzjdRuleForm.remark" type="textarea" autosize
              placeholder="请输入备注(选填)"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer">
        <el-button type="primary" @click="cjzjdSubmit('cjzjdRuleForm')" :loading="cjzjdRuleForm.subimtLoading">提交</el-button>
        <el-button @click="dialogClose('cjzjd')">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 造价单审核 -->
    <el-dialog @close="dialogClose('zjdsh')" :close-on-click-modal="false" :append-to-body="true" title="造价单审核"
      :visible.sync="zjdshVisible" width="700px">
      <div class="scroll-view">
        <el-descriptions class="descriptions" :column="2" border>
          <el-descriptions-item label="报价类型" v-if="fieldShowFunc('zj_quotation_type')">增减项施工报价</el-descriptions-item>
          <el-descriptions-item label="报价金额" v-if="fieldShowFunc('zj_quotation_amount')">
            {{ zjInfo.quotation_amount }}元
          </el-descriptions-item>
          <el-descriptions-item label="基础装修费" v-if="fieldShowFunc('zj_basic_decoration_fee')">
            {{ zjInfo.basic_decoration_fee }}元
          </el-descriptions-item>
          <el-descriptions-item label="主材采购费" v-if="fieldShowFunc('zj_material_costs')">
            {{ zjInfo.material_costs }}元
          </el-descriptions-item>
          <el-descriptions-item label="税金" v-if="fieldShowFunc('zj_quotation_taxes')">
            {{ zjInfo.quotation_taxes }}元
          </el-descriptions-item>
          <el-descriptions-item label="成本金额" v-if="fieldShowFunc('zj_cost_amount')">
            {{ zjInfo.cost_amount }}元
          </el-descriptions-item>
          <el-descriptions-item label="现场采购成本" v-if="fieldShowFunc('zj_procurement_cost')">
            {{ zjInfo.procurement_cost }}元
          </el-descriptions-item>
          <el-descriptions-item label="公司集采成本" v-if="fieldShowFunc('zj_centralized_procurement_cost')">
            {{ zjInfo.centralized_procurement_cost }}元
          </el-descriptions-item>
          <el-descriptions-item label="管理成本" v-if="fieldShowFunc('zj_management_costs')">
            {{ zjInfo.management_costs }}元
          </el-descriptions-item>
          <el-descriptions-item label="利润金额" v-if="fieldShowFunc('zj_profit_amount')">
            {{ zjInfo.profit_amount }}元
          </el-descriptions-item>
          <el-descriptions-item label="利润率" v-if="fieldShowFunc('zj_profit_ratio')">
            {{ zjInfo.profit_ratio }}%
          </el-descriptions-item>
          <el-descriptions-item label="增减项金额" v-if="fieldShowFunc('zj_change_amount')">
            {{ zjInfo.change_amount }}元
          </el-descriptions-item>
          <el-descriptions-item label="报价附件" :span="2" v-if="fieldShowFunc('zj_quotation_file')">
            <template v-for="(item2, idx) in zjInfo.project_quotation_file">
              <span class="theme-color underline span-file" v-if="item2.type == 1" :key="idx"
                @click="$fileViewHandle(item2)">{{ item2.file_name
                }}</span>
            </template>
          </el-descriptions-item>
          <el-descriptions-item label="成本附件" :span="2" v-if="fieldShowFunc('zj_cost_list_file')">
            <template v-for="(item2, idx) in zjInfo.project_quotation_file">
              <span class="theme-color underline span-file" v-if="item2.type == 2" :key="idx"
                @click="$fileViewHandle(item2)">{{ item2.file_name
                }}</span>
            </template>
          </el-descriptions-item>
          <el-descriptions-item label="利润附件" :span="2" v-if="fieldShowFunc('zj_profit_statement_file')">
            <template v-for="(item2, idx) in zjInfo.project_quotation_file">
              <span class="theme-color underline span-file" v-if="item2.type == 3" :key="idx"
                @click="$fileViewHandle(item2)">{{ item2.file_name
                }}</span>
            </template>
          </el-descriptions-item>
        </el-descriptions>

        <el-form :model="zjdshRuleForm" :rules="zjdshRules" ref="zjdshRuleForm" label-position="left" class="form-box">
          <el-form-item label="是否通过" prop="reviewPassed">
            <el-radio-group v-model="zjdshRuleForm.reviewPassed">
              <el-radio :label="1">通过</el-radio>
              <el-radio :label="2">拒绝</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="拒绝理由" prop="remark" v-if="zjdshRuleForm.reviewPassed == 2">
            <el-input :rows="4" class="input-box" v-model="zjdshRuleForm.remark" type="textarea"
              placeholder="请输入拒绝理由"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer">
        <el-button type="primary" @click="shbjdSubmit('zjdshRuleForm')" :loading="zjdshRuleForm.subimtLoading">提交</el-button>
        <el-button @click="dialogClose('zjdsh')">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 提交增项收款凭证 -->
    <el-dialog @close="dialogClose('sfpz')" :close-on-click-modal="false" :append-to-body="true" title="提交增项收款凭证"
      :visible.sync="sfpzVisible" width="700px">
      <el-form :model="sfpzRuleForm" :rules="sfpzRules" ref="sfpzRuleForm" label-position="left">
        <el-form-item label="收款金额" prop="amount_collected">
          <el-input class="input-box" v-model="sfpzRuleForm.amount_collected" v-input-limit="2"
            placeholder="请输入收款金额"></el-input>
        </el-form-item>
        <el-form-item label="收款账户" prop="receiving_account_id">
          <el-select class="input-box" v-model="sfpzRuleForm.receiving_account_id" placeholder="请选择收款账户" filterable
            clearable>
            <el-option v-for="item in companyList" :key="item.id" :label="item.account_name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="凭证文件 (.jpg,.png,.gif,.zip)" prop="payment_voucher">
          <el-upload ref="pzupload" multiple :on-change="sfpzChangeFile" :on-remove="sfpzFileRemove"
            :auto-upload="false" action="#" accept="image/*,.zip">
            <el-button size="small" icon="el-icon-plus">点击上传</el-button>
          </el-upload>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input :rows="4" class="input-box" v-model="sfpzRuleForm.remark" type="textarea"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer">
        <el-button type="primary" @click="sfpzSubmit('sfpzRuleForm')" :loading="sfpzRuleForm.subimtLoading">提交</el-button>
        <el-button @click="dialogClose('sfpz')">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 收款凭证确认 -->
    <el-dialog @close="dialogClose('skqr')" :close-on-click-modal="false" :append-to-body="true" title="增项款凭证确认"
      :visible.sync="skqrVisible" width="700px">
      <div class="scroll-view">
        <el-descriptions class="descriptions" :column="1" border>
          <el-descriptions-item label="收款类型" v-if="fieldShowFunc('payment_type')">增项款</el-descriptions-item>
          <el-descriptions-item label="收款金额" v-if="fieldShowFunc('amount_collected')">
            {{ skInfo.amount_collected }}元
          </el-descriptions-item>
          <el-descriptions-item label="收款账户" v-if="fieldShowFunc('receiving_account')">
            {{ skInfo.receiving_account }}
          </el-descriptions-item>
          <el-descriptions-item label="收款凭证" v-if="fieldShowFunc('voucher_file')">
            <span class="theme-color underline span-file" v-for="(item2, idx) in skInfo.voucher_file" :key="idx"
              @click="$fileViewHandle(item2)">{{ item2.file_name }}</span>
          </el-descriptions-item>
        </el-descriptions>
        <el-form :model="skqrRuleForm" :rules="skqrRules" ref="skqrRuleForm" label-position="left" class="form-box">
          <el-form-item label="打款确认" prop="reviewPassed">
            <el-radio-group v-model="skqrRuleForm.reviewPassed">
              <el-radio :label="1">确认</el-radio>
              <el-radio :label="2">驳回</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="驳回理由" prop="remark" v-if="skqrRuleForm.reviewPassed == 2">
            <el-input :rows="4" class="input-box" v-model="skqrRuleForm.remark" type="textarea"
              placeholder="请输入驳回理由"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer">
        <el-button type="primary" @click="skqrSubmit('skqrRuleForm')" :loading="skqrRuleForm.subimtLoading">提交</el-button>
        <el-button @click="dialogClose('skqr')">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import idiApi from '@/api/increaseDecreaseItemsApi';
import companyApi from "@/api/companyApi";
import adminApi from "@/api/adminApi";
import { getUserInfo } from '@/utils/auth';

export default {
  name: "",
  props: ["change_id"],
  data() {
    return {
      userInfo: {},
      changeInfo: {},

      zjInfo: {},
      skInfo: {},

      // 重新分配造价员
      adminList: [],
      cxfpzjyRuleForm: {
        user_idx: '',
        subimtLoading: false,
      },
      cxfpzjyRules: {
        user_idx: { required: true, message: "请选择造价员", trigger: "change" },
      },
      cxfpzjyVisible: false,

      // 出具造价单
      pickerOptionsEnd: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;
        },
      },
      pickerOptionsStart_: {},
      cjzjdRuleForm: {
        start_date: '',
        end_date: '',
        day: '',
        quotation_amount: null,
        basic_decoration_fee: "",
        material_costs: "",
        quotation_taxes: "",
        cost_amount: null,
        change_amount: "",
        procurement_cost: "",
        centralized_procurement_cost: "",
        management_costs: "",
        profit_amount: null,
        quotation_type: 3,
        quotation_file: [],
        profit_statement_file: [],
        cost_list_file: [],
        remark: '',
        subimtLoading: false,
      },
      cjzjdRules: {
        start_date: [{ required: true, message: '请选择增项预计开工日期', trigger: 'change' }],
        end_date: [{ required: true, message: '请选择增项预计完工日期', trigger: 'change' }],
        day: [],
        basic_decoration_fee: {
          required: true,
          message: "请输入基础装修费用",
          trigger: "change",
        },
        material_costs: {
          required: true,
          message: "请输入主材采购费用",
          trigger: "change",
        },
        quotation_taxes: {
          required: true,
          message: "请输入税金",
          trigger: "change",
        },
        procurement_cost: {
          required: true,
          message: "请输入现场采购成本",
          trigger: "change",
        },
        centralized_procurement_cost: {
          required: true,
          message: "请输入公司集采成本",
          trigger: "change",
        },
        management_costs: {
          required: true,
          message: "请输入管理成本",
          trigger: "change",
        },
        change_amount: {
          required: true,
          message: "请输入增减项金额",
          trigger: "change",
        },
        quotation_file: {
          required: true,
          message: "请上传报价单文件",
          trigger: "change",
        },
        profit_statement_file: {
          required: true,
          message: "请上传利润单文件",
          trigger: "change",
        },
        cost_list_file: {
          required: true,
          message: "请上传成本单文件",
          trigger: "change",
        },
      },
      cjzjdVisible: false,

      // 造价单审核
      zjdshRuleForm: {
        reviewPassed: "",
        remark: "",
        subimtLoading: false,
      },
      zjdshRules: {
        reviewPassed: {
          required: true,
          message: "请选择是否通过",
          trigger: "change",
        },
        remark: {
          required: true,
          message: "请输入拒绝理由",
          trigger: "change",
        },
      },
      zjdshVisible: false,

      // 收费凭证
      companyList: [], //收款账户列表
      sfpzRuleForm: {
        amount_collected: "",
        receiving_account_id: "",
        remark: "",
        payment_voucher: [],
        subimtLoading: false,
      },
      sfpzRules: {
        amount_collected: { required: true, message: "请输入收款金额", trigger: "change" },
        receiving_account_id: { required: true, message: "请选择收款账户", trigger: "change" },
        payment_voucher: { required: true, message: "请上传支付凭证", trigger: "change" },
      },
      sfpzVisible: false,

      // 收款确认
      skqrRuleForm: {
        reviewPassed: '',
        remark: "",
        subimtLoading: false,
      },
      skqrRules: {
        reviewPassed: { required: true, message: "请选择", trigger: "change", },
        remark: { required: true, message: "请输入驳回理由", trigger: "change", },
      },
      skqrVisible: false,
    }
  },
  watch: {
    'cjzjdRuleForm.start_date': {
      handler(newValue) {
        this.pickerOptionsStart_ = {
          disabledDate(time) {
            return time.getTime() < new Date(newValue).getTime() - 8.64e7;
          }
        }
        if (newValue > this.cjzjdRuleForm.end_date) {
          this.cjzjdRuleForm.end_date = '';
          this.cjzjdRuleForm.day = '';
        }
      },
      // 使用深度监听
      deep: true
    }
  },
  computed: {
    changeContent() {
      return type => {
        let res = '';
        switch (type) {
          case 1:
            res = '顶面工程'
            break;
          case 2:
            res = '地面工程'
            break;
          case 3:
            res = '墙面工程'
            break;
          case 4:
            res = '水电工程'
            break;
          case 5:
            res = '楼梯工程'
            break;
          case 6:
            res = '广告工程'
            break;
          case 7:
            res = '外立面工程'
            break;
          case 8:
            res = '其他工程'
            break;
        }
        return res
      }
    },
    countMoney() {
      return (type) => {
        return this.getCountMoney(type);
      };
    },
  },
  mounted() {
    this.userInfo = getUserInfo();
    // 获取增减项详情
    this.getChangeDetails();
  },
  methods: {
    getChangeDetails() {
      idiApi.getChangeDetails({
        change_id: this.change_id
      }).then(res => {
        console.log(res, '增减项详情')
        if (res.code == 200) {
          this.changeInfo = res.data;
        }
      })
    },
    // 收款账户列表
    getCompanyList() {
      companyApi.getCompanyList({
        page: 1,
        num: 9999,
        account_type: 1,
      }).then((res) => {
        console.log(res, "收款账户");
        if (res.code == 200) {
          this.companyList = res.data.list;
        } else {
          this.$message.warning(res.message);
        }
      }).catch((err) => {
        this.$message.warning(err.message);
      });
    },
    dialogOpen(type) {
      switch (type) {
        case "cxfpzjy":
          this.getAdminList();
          this.cxfpzjyVisible = true;
          break;
        case "cjzjd":
          // 获取历史报价
          var changeInfo = this.changeInfo;
          var arr = [];
          changeInfo.log_list.map(item => {
            if (item.change_status == 20) {
              arr.push(item);
            }
          })
          if (changeInfo.increase_or_decrease == 1) {
            this.cjzjdRuleForm.start_date = changeInfo.start_date;
            this.cjzjdRuleForm.end_date = changeInfo.end_date;
            this.cjzjdRuleForm.day = changeInfo.expect_duration_days;
          }
          if (arr.length > 0) {
            let item = arr[0].form_data
            this.cjzjdRuleForm.quotation_type = item.quotation_type;
            this.cjzjdRuleForm.basic_decoration_fee = item.basic_decoration_fee;
            this.cjzjdRuleForm.material_costs = item.material_costs;
            this.cjzjdRuleForm.quotation_taxes = item.quotation_taxes;
            this.cjzjdRuleForm.procurement_cost = item.procurement_cost;
            this.cjzjdRuleForm.centralized_procurement_cost = item.centralized_procurement_cost;
            this.cjzjdRuleForm.management_costs = item.management_costs;
            this.cjzjdRuleForm.change_amount = item.change_amount;
          }
          this.cjzjdVisible = true;
          break;
        case "zjdsh":
          var changeInfo = this.changeInfo;
          var arr = [];
          changeInfo.log_list.map(item => {
            if (item.change_status == 20) {
              arr.push(item);
            }
          })
          if (arr.length > 0) {
            this.zjInfo = arr[0].form_data
          }
          this.zjdshVisible = true;
          break;
        case 'sfpz':
          this.getCompanyList();
          this.sfpzVisible = true;
          break;
        case 'skqr':
          var changeInfo = this.changeInfo;
          var arr = [];
          changeInfo.log_list.map(item => {
            if (item.change_status == 50) {
              arr.push(item);
            }
          })
          if (arr.length > 0) {
            this.skInfo = arr[0].form_data
          }
          this.skqrVisible = true;
          break;
      }
    },
    dialogClose(type) {
      switch (type) {
        case "cxfpzjy":
          this.cxfpzjyRuleForm = this.$options.data().cxfpzjyRuleForm;
          this.$nextTick(() => {
            this.$refs["cxfpzjyRuleForm"].clearValidate();
            this.cxfpzjyVisible = false;
          });
          break;
        case "cjzjd":
          this.cjzjdRuleForm = this.$options.data().cjzjdRuleForm;
          this.$nextTick(() => {
            console.log(this.$refs['bjupload'])
            this.$refs['bjupload'].clearFiles();
            this.$refs['cbupload'].clearFiles();
            this.$refs['lrupload'].clearFiles();
            this.$refs['cjzjdRuleForm'].clearValidate();
            this.cjzjdVisible = false;
          });
          break;
        case "zjdsh":
          this.zjdshRuleForm = this.$options.data().zjdshRuleForm;
          this.$nextTick(() => {
            this.$refs["zjdshRuleForm"].clearValidate();
            this.zjdshVisible = false;
          });
          break;
        case 'sfpz':
          this.sfpzRuleForm = this.$options.data().sfpzRuleForm;
          this.$nextTick(() => {
            this.$refs['pzupload'].clearFiles();
            this.$refs['sfpzRuleForm'].clearValidate();
            this.sfpzVisible = false;
          })
          break;
        case 'skqr':
          this.skqrRuleForm = this.$options.data().skqrRuleForm;
          this.$nextTick(() => {
            this.$refs['skqrRuleForm'].clearValidate();
            this.skqrVisible = false;
          })
          break;
      }
    },
    // 重新分配造价员
    getAdminList() {
      adminApi.getAdminList({
        page: 1,
        num: 99,
        identity: 1,
        position_id_arr: [5],
      }).then(res => {
        console.log(res, '获取造价员列表')
        if (res.code == 200) {
          this.adminList = res.data.list;
        }
      })
    },
    cxfpzjySubmit(formName) {
      let cxfpzjyRuleForm = this.cxfpzjyRuleForm;
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.cxfpzjyRuleForm.subimtLoading = true;
          idiApi.changeItemsAssignCostEstimator({
            project_id: this.changeInfo.project_id,
            change_id: this.change_id,
            cost_estimator_id: this.adminList[cxfpzjyRuleForm.user_idx].id,
          }).then(res => {
            if (res.code == 200) {
              this.getChangeDetails();
              this.dialogClose('cxfpzjy');
            }
            this.cxfpzjyRuleForm.subimtLoading = false;
            this.$message({
              type: res.code == 200 ? "success" : "warning",
              message: res.code == 200 ? "操作成功" : res.message,
            });
          })
        }
      })
    },
    // 出具造价单
    startDateChange(e) {
      let end_date = this.cjzjdRuleForm.end_date;
      if (end_date) {
        let day = this.getDaysBetweenDates(end_date, e);
        this.cjzjdRuleForm.day = day + 1;
      }
    },
    endDateChange(e) {
      let start_date = this.cjzjdRuleForm.start_date;
      let day = this.getDaysBetweenDates(start_date, e);
      this.cjzjdRuleForm.day = day + 1;
    },
    getDaysBetweenDates(date1, date2) {
      // 将日期字符串转换为时间戳
      var timestamp1 = new Date(date1).getTime();
      var timestamp2 = new Date(date2).getTime();

      // 计算两个时间戳之间的天数
      var days = Math.ceil(Math.abs(timestamp2 - timestamp1) / (1000 * 3600 * 24));

      return days;
    },
    getCountMoney(type) {
      let res = 0;
      let cjzjdRuleForm = this.cjzjdRuleForm;
      let val1 = cjzjdRuleForm.basic_decoration_fee
        ? Number(cjzjdRuleForm.basic_decoration_fee)
        : 0;
      let val2 = cjzjdRuleForm.material_costs
        ? Number(cjzjdRuleForm.material_costs)
        : 0;
      let val3 = cjzjdRuleForm.quotation_taxes
        ? Number(cjzjdRuleForm.quotation_taxes)
        : 0;
      let val4 = cjzjdRuleForm.procurement_cost
        ? Number(cjzjdRuleForm.procurement_cost)
        : 0;
      let val5 = cjzjdRuleForm.centralized_procurement_cost
        ? Number(cjzjdRuleForm.centralized_procurement_cost)
        : 0;
      let val6 = cjzjdRuleForm.management_costs
        ? Number(cjzjdRuleForm.management_costs)
        : 0;
      let bj = Math.floor((val1 + val2 + val3) * 100) / 100;
      let cb = Math.floor((val4 + val5 + val6 + val3) * 100) / 100;
      let lr = Math.floor((bj - cb) * 100) / 100;
      let lrl = 0;
      if (lr == 0) {
        lrl = 0;
      } else if (cb == 0) {
        lrl = 100;
      } else {
        lrl = Math.floor((lr / cb) * 10000) / 100;
      }
      switch (type) {
        case "bj":
          res = bj;
          break;
        case "cb":
          res = cb;
          break;
        case "lr":
          res = lr;
          break;
        case "lrl":
          res = lrl;
          break;
      }
      if (type == "all") {
        return {
          bj,
          cb,
          lr,
          lrl,
        };
      }
      return res;
    },
    cjzjdChangeFile(file, fileList, type) {
      this.cjzjdRuleForm[type] = fileList;
    },
    cjzjdFileRemove(file, fileList, type) {
      this.cjzjdRuleForm[type] = fileList;
    },
    cjzjdSubmit(formName) {
      let cjzjdRuleForm = this.cjzjdRuleForm;
      console.log(cjzjdRuleForm, "出具造价单参数");
      this.$refs[formName].validate((valid) => {
        if (valid) {
          let amount = this.getCountMoney("all");
          this.cjzjdRuleForm.subimtLoading = true;
          let formdata = new FormData();
          let obj = {
            project_id: this.changeInfo.project_id,
            change_id: this.change_id,
            change_amount: cjzjdRuleForm.change_amount,
            quotation_amount: amount.bj,
            basic_decoration_fee: cjzjdRuleForm.basic_decoration_fee,
            material_costs: cjzjdRuleForm.material_costs,
            quotation_taxes: cjzjdRuleForm.quotation_taxes,
            cost_amount: amount.cb,
            procurement_cost: cjzjdRuleForm.procurement_cost,
            centralized_procurement_cost: cjzjdRuleForm.centralized_procurement_cost,
            management_costs: cjzjdRuleForm.management_costs,
            profit_amount: amount.lr,
            profit_ratio: amount.lrl,
            quotation_type: cjzjdRuleForm.quotation_type,
            remark: cjzjdRuleForm.remark,
          }
          console.log(obj);
          formdata.append('data', JSON.stringify(obj))
          cjzjdRuleForm.quotation_file.forEach(item => {
            formdata.append('quotation_file[]', item.raw);
          })
          cjzjdRuleForm.profit_statement_file.forEach(item => {
            formdata.append('profit_statement_file[]', item.raw);
          })
          cjzjdRuleForm.cost_list_file.forEach(item => {
            formdata.append('cost_list_file[]', item.raw);
          })
          idiApi.issueChangeQuotation(formdata).then((res) => {
            console.log(res, "出具造价单");
            if (res.code == 200) {
              this.getChangeDetails();
              this.dialogClose("cjzjd");
              if (typeof this.$parent.$parent.getOperList == 'function') {
                this.$parent.$parent.getOperList(2)
              }
            }
            this.cjzjdRuleForm.subimtLoading = false;
            this.$message({
              type: res.code == 200 ? "success" : "warning",
              message: res.code == 200 ? "操作成功" : res.message,
            });
          }).catch((err) => {
            this.cjzjdRuleForm.subimtLoading = false;
            this.$message.warning(err.message);
          });
        }
      });
    },
    // 造价单审核
    shbjdSubmit(formName) {
      let zjdshRuleForm = this.zjdshRuleForm;
      console.log(zjdshRuleForm, "造价单审核参数");
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.zjdshRuleForm.subimtLoading = true;
          if (zjdshRuleForm.reviewPassed == 1) {
            idiApi.changeQuotationPassed({
              project_id: this.changeInfo.project_id,
              change_id: this.change_id,
              remark: zjdshRuleForm.remark
            }).then(res => {
              console.log(res, '审核通过')
              if (res.code == 200) {
                this.getChangeDetails();
                this.dialogClose('zjdsh');
                if (typeof this.$parent.$parent.getOperList == 'function') {
                  this.$parent.$parent.getOperList(2)
                }
              }
              this.zjdshRuleForm.subimtLoading = false;
              this.$message({
                type: res.code == 200 ? "success" : "warning",
                message: res.code == 200 ? "操作成功" : res.message,
              });
            })
          } else {
            idiApi.changeQuotationRejected({
              project_id: this.changeInfo.project_id,
              change_id: this.change_id,
              remark: zjdshRuleForm.remark
            }).then(res => {
              console.log(res, '审核拒绝')
              if (res.code == 200) {
                this.getChangeDetails();
                this.dialogClose('zjdsh');
                if (typeof this.$parent.$parent.getOperList == 'function') {
                  this.$parent.$parent.getOperList(2)
                }
              }
              this.zjdshRuleForm.subimtLoading = false;
              this.$message({
                type: res.code == 200 ? "success" : "warning",
                message: res.code == 200 ? "操作成功" : res.message,
              });
            })
          }
        }
      })
    },

    // 收款凭证
    sfpzChangeFile(file, fileList) {
      this.sfpzRuleForm.payment_voucher = fileList;
    },
    sfpzFileRemove(file, fileList) {
      this.sfpzRuleForm.payment_voucher = fileList;
    },
    sfpzSubmit(formName) {
      let sfpzRuleForm = this.sfpzRuleForm;
      console.log(sfpzRuleForm, "收费凭证提交");
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.sfpzRuleForm.subimtLoading = true;
          let obj = {
            project_id: this.changeInfo.project_id,
            change_id: this.change_id,
            amount_collected: sfpzRuleForm.amount_collected,
            receiving_account_id: sfpzRuleForm.receiving_account_id,
            remark: sfpzRuleForm.remark
          }
          let formdata = new FormData();
          formdata.append('data', JSON.stringify(obj))
          sfpzRuleForm.payment_voucher.forEach(item => {
            formdata.append('payment_voucher[]', item.raw);
          })
          idiApi.submitChangeVouchers(formdata).then(res => {
            console.log(res, '提交收费凭证')
            if (res.code == 200) {
              this.getChangeDetails();
              this.dialogClose('sfpz');
              if (typeof this.$parent.$parent.getOperList == 'function') {
                this.$parent.$parent.getOperList(2)
              }
            }
            this.sfpzRuleForm.subimtLoading = false;
            this.$message({
              type: res.code == 200 ? "success" : "warning",
              message: res.code == 200 ? "操作成功" : res.message,
            });
          })
        }
      })
    },

    // 收款确认
    skqrSubmit(formName) {
      let skqrRuleForm = this.skqrRuleForm;
      console.log(skqrRuleForm, "收费凭证提交");
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.skqrRuleForm.subimtLoading = true;
          if (skqrRuleForm.reviewPassed == 1) {
            idiApi.confirmChangeVouchers({
              project_id: this.changeInfo.project_id,
              change_id: this.change_id,
              remark: skqrRuleForm.remark
            }).then(res => {
              console.log(res, '财务确认')
              if (res.code == 200) {
                this.getChangeDetails();
                this.dialogClose('skqr');
                if (typeof this.$parent.$parent.getOperList == 'function') {
                  this.$parent.$parent.getOperList(2)
                }
              }
              this.skqrRuleForm.subimtLoading = false;
              this.$message({
                type: res.code == 200 ? "success" : "warning",
                message: res.code == 200 ? "操作成功" : res.message,
              });
            })
          } else {
            idiApi.refuseChangeVouchers({
              project_id: this.changeInfo.project_id,
              change_id: this.change_id,
              remark: skqrRuleForm.remark,
            }).then((res) => {
              console.log(res, "财务驳回");
              if (res.code == 200) {
                this.getChangeDetails();
                this.dialogClose('skqr');
                if (typeof this.$parent.$parent.getOperList == 'function') {
                  this.$parent.$parent.getOperList(2)
                }
              }
              this.skqrRuleForm.subimtLoading = false;
              this.$message({
                type: res.code == 200 ? "success" : "warning",
                message: res.code == 200 ? "操作成功" : res.message,
              });
            })
          }

        }
      });
    },

  },
};
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>